import math

import pygame.draw
from pygame import Vector2

from cores.core import Camera


class Drawer:
    @classmethod
    def ray(cls, point: Vector2, rad: float, length = 25, **kwargs):
        pygame.draw.aaline(Camera.screen,
                           kwargs.get("color", "green"),
                           Camera.campos(point),
                           Camera.campos(point + Vector2(
                               -length * math.sin(rad), -length * math.cos(rad)
                           )),
                           kwargs.get("width", 3))
        pygame.draw.circle(Camera.screen,
                           kwargs.get("color", "red"),
                           Camera.campos(point + Vector2(
                               -length * math.sin(rad), -length * math.cos(rad),
                           )), 5)

